<#assign base=request.contextPath />
<!DOCTYPE html>
<html>
<head>
  <base href="${base}">	
  <meta charset="utf-8">
  <title>通知公告管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="${base}/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="${base}/layuiadmin/style/admin.css" media="all">
  <link rel="stylesheet" href="${base}/css/my.css" media="all">
  <style>
  	h2 {
  		text-align: center;
  		line-height: 50px;
  		font-size: 30px;
  	}
  	h3 {
  		text-align: center;
  		display: flex;
  		justify-content: space-around;
  	}
  	.txt {
  		text-indent: 2em;
  		padding: 20px;
  	}
  	li a {
  		text-decoration: underline;
  		color: blue;
  		line-height: 30px;
  		margin-left: 40px;
  	}
  </style>
</head>

<body>
	<div class="layui-fluid">
		<div>
			<h2>${tongbao.title}</h2>
			<h3><span>发布单位：${tongbao.dept.depName}</span><span>发布时间：${tongbao.ctime}</span></h3>
		</div>
		<div class="txt">
			${tongbao.content}
		</div>
		<div class="files"></div>
	</div>
	
  	<script src="${base}/layuiadmin/layui/layui.js"></script>
  	<script>
  	layui.config({
    	base: '${base}/layuiadmin/' //静态资源所在路径
  	}).extend({
    	index: 'lib/index'
  	}).use(['index'], function(){
    	var $ = layui.$;
    	
    	var files = JSON.parse('${tongbao.files}');
    	for(var i=0; i<files.length; i++) {
    		$('.files').append('<li><a href="javascript:download(\''+files[i].src+'\', \''+files[i].title+'\')">'+files[i].title+'</a></li>');
    	}

  	});
  	
  	function download(path, title) {
  		window.location.href = '${base}/file/download?path='+path + '&title='+title;
  	}
  </script>
</body>
</html>
